<?php
/**
 * Bulk Upload, for securiry requeirement
 * 
 * CSV format. (NOTE) - Sequence must be be follow
 * 
 * account_name
 * password
 * lname
 * fname
 * email
 * store_name
 */

?>
<style type="text/stylesheet">
    .centerme{
     margin: 0 auto; min-width: 50%;border: 1px solid red;max-width: 50%;text-align: center;       
    }
</style>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('skin/css/admin.css');?>" />

<div id="tabs-3" class="ui-tabs-panel ui-widget-content ui-corner-bottom" aria-labelledby="ui-id-1" role="tabpanel" aria-hidden="false">
    
        <?php $success = $this->session->flashdata('success');?>
        <?php if ($success): ?>
            <div class="centerme" style="color:green;"><?php echo $success; ?></div>
        <?php else: ?>
            <?php $error = $this->session->flashdata('error');?>
            <?php if ($error):?>
            <div class="centerme" style="color:red;"><?php echo $error; ?></div>
            <?php endif;?>
        <?php endif;?>
    
    <br />
    <form action="<?php echo site_url('bulk/upload');?>" method="POST" enctype="multipart/form-data">
        <table style="width:auto;">
            <tbody>
                <tr>
                    <td style="text-align:left;" width="20%">File:</td>
                    <td style="text-align:left;"><input type="file" name="filename" id="fileToUpload"></td>
                </tr>
                <tr>
                    <th style="text-align: center;" colspan="2"><input type="submit" name="submit" value="Upload" /></th>
                </tr>
            </tbody>  
        </table>
    </form>
    
    <br /><hr /><hr />
    <form action="<?php echo site_url('bulk/process');?>" method="POST">
        <table style="width:auto;">
            <tbody>
                <tr>
                    <td style="text-align:left;" width="20%">File:</td>
                    <td style="text-align:left;">
                        <select name="file">
                            <option value="">Select file</option>
                        <?php if (isset($files))foreach ($files as $k => $file):?>
                            <option value="<?php echo $file?>"><?php echo $file ?></option>
                        <?php endforeach;?>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th style="text-align: center;" colspan="2"><input type="submit" name="process" value="Process" /></th>
                </tr>
            </tbody>  
        </table>
    </form>

</div>
